package com.ruoyi.Outsider.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.Outsider.mapper.OutsiderMapper;
import com.ruoyi.Outsider.domain.Outsider;
import com.ruoyi.Outsider.service.IOutsiderService;

/**
 * 外来人口访问登记Service业务层处理
 * 
 * @author 张柏焰
 * @date 2024-07-07
 */
@Service
public class OutsiderServiceImpl implements IOutsiderService 
{
    @Autowired
    private OutsiderMapper outsiderMapper;

    /**
     * 查询外来人口访问登记
     * 
     * @param id 外来人口访问登记主键
     * @return 外来人口访问登记
     */
    @Override
    public Outsider selectOutsiderById(Long id)
    {
        return outsiderMapper.selectOutsiderById(id);
    }

    @Override
    public List<Outsider> selectOutsiderByPhone(String phone) {
        return outsiderMapper.selectOutsiderByPhone(phone);
    }

    /**
     * 查询外来人口访问登记列表
     * 
     * @param outsider 外来人口访问登记
     * @return 外来人口访问登记
     */
    @Override
    public List<Outsider> selectOutsiderList(Outsider outsider)
    {
        return outsiderMapper.selectOutsiderList(outsider);
    }

    /**
     * 新增外来人口访问登记
     * 
     * @param outsider 外来人口访问登记
     * @return 结果
     */
    @Override
    public int insertOutsider(Outsider outsider)
    {
        outsider.setCreateTime(DateUtils.getNowDate());
        return outsiderMapper.insertOutsider(outsider);
    }

    /**
     * 修改外来人口访问登记
     * 
     * @param outsider 外来人口访问登记
     * @return 结果
     */
    @Override
    public int updateOutsider(Outsider outsider)
    {
        outsider.setUpdateTime(DateUtils.getNowDate());
        return outsiderMapper.updateOutsider(outsider);
    }

    /**
     * 批量删除外来人口访问登记
     * 
     * @param ids 需要删除的外来人口访问登记主键
     * @return 结果
     */
    @Override
    public int deleteOutsiderByIds(Long[] ids)
    {
        return outsiderMapper.deleteOutsiderByIds(ids);
    }

    /**
     * 删除外来人口访问登记信息
     * 
     * @param id 外来人口访问登记主键
     * @return 结果
     */
    @Override
    public int deleteOutsiderById(Long id)
    {
        return outsiderMapper.deleteOutsiderById(id);
    }
}
